<!DOCTYPE html>
<html>
<head>
  <meta content="IE=11.0000" http-equiv="X-Ua-Compatible">
  <meta charset="utf-8">
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-Ua-Compatible" content="IE=edge,chrome=1">

  <title>添加凭证</title>
  <!--region 引入公用js和css -->
  <link href="../assets/plugins/animate/animate.css" rel="stylesheet">
  <link href="../assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
  <link href="../assets/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"/>
  <link href="../assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
  <link href="../assets/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css"/>
  <link href="../assets/plugins/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css"/>
  <link href="../assets/base/css/components.css" rel="stylesheet" id="style_components" type="text/css"/>
  <link href="../assets/base/css/plugins.css" rel="stylesheet" type="text/css"/>
  <link href="../assets/ditop/layout.css" rel="stylesheet" type="text/css"/>
  <link href="../assets/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css"/>
  <link href="../assets/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css"/>
  <link href="../assets/plugins/bootstrap-table/bootstrap-table.css" rel="stylesheet">
  <link href="../assets/plugins/bootstrap-table/extensions/tree-column/bootstrap-table-tree-column.css" rel="stylesheet">
  <link href="../assets/plugins/bootstrap-toastr/toastr.css" rel="stylesheet">
  <link rel="stylesheet" href="../assets/plugins/sweetalert/sweetalert.css">
  <link rel="stylesheet" href="../assets/plugins/layer/theme/default/layer.css">
  <link href="../assets/plugins/select2/css/select2.min.css" rel="stylesheet">
  <link href="../assets/plugins/icheck/skins/flat/aero.css" rel="stylesheet">
  <link href="../assets/ditop/ditop.css" rel="stylesheet">
  <link href="../assets/ditop/style/ztree/style9/treestyle.css" rel="stylesheet">
  <link href="../assets/plugins/bootstrap-touchspin/bootstrap.touchspin.css" rel="stylesheet">
  <link href="../assets/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css" rel="stylesheet" type="text/css"/>
  <script src="../assets/plugins/jquery/jquery.min.js"></script>
  <script src="../assets/plugins/bootstrap/js/bootstrap.min.js"></script>
  <script src="../assets/plugins/bootstrap-toastr/toastr.js"></script>
  <script src="../assets/plugins/art-template/template.js"></script>
  <script src="../assets/plugins/layer/layer.js"></script>
  <script src="../assets/ditop/ditop.js"></script>
  <link href="public.css" rel="stylesheet"> <!-- CSS Customization -->
  <link href="../assets/module/gcjsy/css/pagination.css" rel="stylesheet">
  <!--endregion-->
  
  <link rel="stylesheet" href="market.css">
  <style>
    .distinction{
      /*height: calc(100% - 65px);*/
      /*overflow-y: auto;*/
    }
  </style>
</head>


<body class="page-footer-fixed page-content-white">

<div class="popup-box h-100p padding-bottom-65">
  <div class="distinction h-100p padding16">
    <div class="input-form">
      <div class="query-item">
        <b class="query-title"><font class="red">*</font>付款单位</b>
        <div class="query-right relative">
          <input name="paymentUnit" class="form-control" readonly style="width: 414px" type="text" placeholder="">
          <span class="help-block"></span>
          <div class="mc-content clearfix">
            <ul class="mc-list">
              <li><span>付款单位1</span><i class="dtFont dtFont-gengduo"></i></li>
              <li><span>付款单位1</span><i class="dtFont dtFont-gengduo"></i></li>
              <li><span>付款单位1</span><i class="dtFont dtFont-gengduo"></i></li>
              <li><span>付款单位1</span><i class="dtFont dtFont-gengduo"></i></li>
              <li><span>付款单位1</span></li>
            </ul>
            <ul class="mc-sub-list">
              <li>付款单位1-1</li>
              <li>付款单位1-1</li>
              <li>付款单位1-1</li>
              <li>付款单位1-1</li>
              <li>付款单位1-1</li>
              <li>付款单位1-1</li>
              <li>付款单位1-1</li>
              <li>付款单位1-1</li>
            </ul>
          </div>
        </div>
      </div>
      <div class="query-item">
        <b class="query-title"><font class="red">*</font>收款单位</b>
        <div class="query-right relative">
          <input name="payee" class="form-control" readonly style="width: 414px" type="text" placeholder="">
          <span class="help-block"></span>
          <div class="mc-content clearfix">
            <ul class="mc-list">
              <li><span>收款单位1</span><i class="dtFont dtFont-gengduo"></i></li>
              <li><span>收款单位1</span><i class="dtFont dtFont-gengduo"></i></li>
              <li><span>收款单位1</span><i class="dtFont dtFont-gengduo"></i></li>
              <li><span>收款单位1</span><i class="dtFont dtFont-gengduo"></i></li>
              <li><span>收款单位1</span></li>
            </ul>
            <ul class="mc-sub-list">
              <li>收款单位1-1</li>
              <li>收款单位1-1</li>
              <li>收款单位1-1</li>
              <li>收款单位1-1</li>
              <li>收款单位1-1</li>
              <li>收款单位1-1</li>
              <li>收款单位1-1</li>
              <li>收款单位1-1</li>
            </ul>
          </div>
        </div>
      </div>
      <div class="query-item">
        <b class="query-title"><font class="red">*</font>支付金额</b>
        <div class="query-right" style="width: 230px;">
          <div class="input-group">
            <input name="paymentAmount" type="text" class="form-control" placeholder="">
            <span class="input-group-addon">万元</span>
            <span class="help-block"></span>
          </div>
        </div>
      </div>
      <div class="query-item">
        <b class="query-title"><font class="red">*</font>支付日期</b>
        <div class="query-right relative">
          <i class="fa fa-calendar-o"></i>
          <input name="paymentDate" type="text" style="width: 228px;" class="form-control active" placeholder="">
          <span class="help-block"></span>
        </div>
      </div>
      <div class="query-item">
        <b class="query-title"><font class="red">*</font>上报月度</b>
        <div class="query-right relative">
          <i class="fa fa-calendar-o"></i>
          <input name="reportMonthly" type="text" style="width: 228px;" class="form-control active" placeholder="">
          <span style="position: absolute" class="help-block"></span>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="referTo border">
  <button id="cancel" class="basicsBtn grayLine" href="javascript:;">取消</button>
  <button id="submit" class="basicsBtn blue" href="javascript:;">确定</button>
</div>

<!--region 引入公用js和css -->
<script src="../assets/plugins/sweetalert/sweetalert.min.js"></script>
<script src="../assets/plugins/jquery.blockui.min.js"></script>
<script src="../assets/plugins/js.cookie.min.js"></script>
<script src="../assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script src="../assets/plugins/jquery.blockui.min.js"></script>
<script src="../assets/plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script>
<script src="../assets/plugins/bootstrap-touchspin/bootstrap.touchspin.js"></script>
<script src="../assets/plugins/moment.min.js"></script>
<script src="../assets/plugins/bootstrap-daterangepicker/daterangepicker.min.js"></script>
<script src="../assets/plugins/counterup/jquery.waypoints.min.js"></script>
<script src="../assets/plugins/counterup/jquery.counterup.min.js"></script>
<script src="../assets/plugins/fullcalendar/fullcalendar.js"></script>
<script src="../assets/plugins/horizontal-timeline/horizontal-timeline.js"></script>
<script src="../assets/plugins/jquery.sparkline.min.js"></script>
<script src="../assets/plugins/select2/js/select2.js"></script>
<script src="../assets/plugins/select2/js/i18n/zh-CN.js"></script>
<script src="../assets/plugins/ztree/jquery.ztree.all.js"></script>
<script src="../assets/plugins/jquery-form/jquery.form.js"></script>
<script src="../assets/plugins/jquery-validator/jquery.placeholder.min.js"></script>
<script src="../assets/plugins/jquery-validator/jquery.validate.js"></script>
<script src="../assets/plugins/jquery-validator/jquery.validate.custom.js"></script>
<script src="../assets/plugins/jquery-validator/localization/messages_zh.js"></script>
<script src="../assets/plugins/jquery-validator/additional-methods.js"></script>
<script src="../assets/plugins/bootstrap-growl/jquery.bootstrap-growl.js"></script>
<script src="../assets/plugins/bootstrap-table/bootstrap-table.js"></script>
<script src="../assets/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
<script src="../assets/plugins/bootstrap-table/extensions/tree-column/bootstrap-table-tree-column.js"></script>
<script src="../assets/base/scripts/app.js"></script>
<script src="../assets/base/scripts/theme.js"></script>
<script src="../assets/ditop/ditop-addition.js"></script>
<script src="../assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js" type="text/javascript"></script>
<script src="../assets/plugins/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"
        type="text/javascript"></script>
<script type="text/javascript" src="../assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"
        charset="UTF-8"></script>
<script type="text/javascript"
        src="../assets/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
        charset="UTF-8"></script>
<script src="../assets/plugins/jquery-validator/jquery.validate.custom.js"></script>
<script src="../assets/ditop/layout.js"></script>
<!--endregion-->

<script>
  var pwin = layer.getOpenFromWindow();
  
  $("input[name='paymentUnit']").on("click",function (e) {
    e.stopPropagation();
    $(this).closest(".query-item").siblings().find(".mc-content").children().hide();
    $(this).siblings(".mc-content").find(".mc-list").show();
    paymentClick();
  });

  $("input[name='payee']").on("click",function (e) {
    e.stopPropagation();
    $(this).closest(".query-item").siblings().find(".mc-content").children().hide();
    $(this).siblings(".mc-content").find(".mc-list").show();
    paymentClick();
  });

  function paymentClick(){
    $(document).bind("click", function(e) {
      var target = $(e.target);
      console.log(target,target.closest(".mc-content").length)
      if (target.closest(".mc-content").length === 0) {
        $(".mc-content").children().hide();
      }
    });
    $(".mc-list li").on("click",function () {
      $(this).addClass("active").siblings().removeClass("active");
      if($(this).children("i").length){
        $(this).parent().next().show();
      }else{
        $(this).closest(".mc-content").siblings("input").val($(this).text());
        $(".mc-content").children().hide();
      }
    });

    $(".mc-sub-list li").on("click",function () {
      $(this).closest(".mc-content").siblings("input").val($(this).text());
      $(".mc-content").children().hide();
    })
  }
  
  function loadHtml(){
    var payItem = pwin.payItem||{};
    $("input[name='paymentUnit']").val(payItem.paymentUnit);
    $("input[name='payee']").val(payItem.payee);
    $("input[name='paymentAmount']").val(payItem.paymentAmount);
    $("input[name='paymentDate']").val(payItem.paymentDate);
    $("input[name='reportMonthly']").val(payItem.reportMonthly);
  }loadHtml();
  
  $("#submit").on("click",function () {
    var payItem={
      paymentUnit: $("input[name='paymentUnit']").val(),
      payee: $("input[name='payee']").val(),
      paymentAmount: $("input[name='paymentAmount']").val(),
      paymentDate: $("input[name='paymentDate']").val(),
      reportMonthly: $("input[name='reportMonthly']").val(),
    };
    layer.closeCurrent(window);
    window.dtLayerCallback && window.dtLayerCallback(payItem);
  })
</script>
</body>
</html>
